import Vue from 'vue'
import VueRouter from 'vue-router'
import Rank from '@/components/rank/rank'
// import Recmomend from '@/components/recommend/recommend'
import Lunbotu from '@/components/recommend/lunbo.vue'
import Search from '@/components/search/search'
import Singer from '@/components/singer/singer'
import SingerDetail from '@/components/singer-detall/singer-detall'
import Disc from '@/components/disc/disc'
import TopList from '@/components/top-list/top-list'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/lunbo'
    // children: [
    //   {
    //     path: '/lunbo/:id',
    //     component: Disc
    //   }
    // ]
  },
  {
    path: '/rank',
    component: Rank
  },
  {
    path: '/lunbo',
    component: Lunbotu
  },
  {
    path: '/search',
    component: Search
  },
  {
    path: '/singer',
    component: Singer
    // children: [
    //   {
    //     path: ':id',
    //     component: SingerDetail
    //   }
    // ]
  },
  {
    path: '/singer/:id',
    component: SingerDetail,
    name: 'SingerDetail'
  },
  {
    path: '/search/singer/:id',
    component: SingerDetail,
    name: 'SearchSuggest'
  },
  {
    path: '/lunbo/:id',
    component: Disc,
    name: 'LunboDisc'
  },
  {
    path: '/rank/:id',
    component: TopList,
    name: 'Ranktoplist'
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
